part of _;

extension on ShowVideoPage {
  void controller_save() async {
    yShowProgress();
    await DesktopMultiWindow.invokeMethod(0, "saveFile", {
      "url": video,
    });
    yDismissProgress();
    yToast("视频已保存到下载目录");
  }

  void controller_disposeVideo() {
    meeduPlayerController.dispose();
  }

  void controller_initVideo() {
    meeduPlayerController.loadingWidget = Loader();
    meeduPlayerController.onVideoFitChange(BoxFit.fitHeight);
    meeduPlayerController.setDataSource(
      DataSource(
        type: DataSourceType.network,
        source: video,
      ),
      autoplay: true,
      looping: true,
    );
  }
}
